<!--
<?php
/*
 require_once("../../sqlconfig.php");

 mysql_connect($server, $sqlusr, $sqlpass) or die(mysql_error()); 
 mysql_select_db($mydb) or die(mysql_error());
 
 //Checks if there is a login cookie
 if(isset($_COOKIE["parentinformerprcshs"]) || isset($_COOKIE["parentinformerurcshs"])) { 
  if(isset($_COOKIE["parentinformerprcshs"])) {
   $username = $_COOKIE["parentinformerprcshs"]; 
  }
  else {
   $_SESSION['theerrcode'] = 2;
   header("Location: ../logerr_atmpt.php");
  }
  $pass = $_COOKIE["parentinformerurcshs"];
  $check = mysql_query("SELECT * FROM logtbl WHERE usernm = '".$username."'") or die(mysql_error());
  while($info=mysql_fetch_array($check)) {
   if ($pass!=$info['pwrnd']) {
    $_SESSION['theerrcode'] = 2;
    header("Location: ../logerr_atmpt.php");
   }
   else {
*/
   
    if(isset($_POST['filen'])) {

     if(!isset($_SERVER['PHP_AUTH_USER'])) {
      header("WWW-Authenticate: Basic realm=\"Student Grades\"");
      header("HTTP/1.0 401 Unauthorized");
      echo "You have not entered any credentials. Please try again\n";
      echo "by refreshing the page.\n";
      exit;
     }
     else {
      if((md5($_SERVER['PHP_AUTH_USER']) == $username) && (md5($_SERVER['PHP_AUTH_PW']) == $pass)) {
       $getf = $_POST['filen'].".csv";
       header('Content-type: text/csv');
       header('Content-Disposition: attachment; filename="'.$_SERVER['DOCUMENT_ROOT'].'/modules/recd/csv/'.$getf.'"');
	   header('Cache-control: private');
       readfile($_SERVER['DOCUMENT_ROOT'].'/modules/rect/csv/'.$getf);
      }
	  else {
       echo "You have entered invalid credentials. Please try again\n";
       echo "by refreshing the page.\n";
	   exit;
	  }
	  unset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
	 }
    }
    else {
     header("Location: ../../../");
    }
	
	/*
   }
  }
 }
 else {
  header("Location: ../../../");
 }*/
?>

-->